﻿// -----------------------------------------------------------------------
// <copyright file="EqualizerMask.cs" company="Abyssalsoft">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace Gui.Player.Equalizer
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using Metal.Player.Equalizer;

    /// <summary>
    /// Equalizer mask
    /// </summary>
    public partial class EqualizerMask : Gui.BaseMask.BaseMask, IEqualizerView
    {
        #region Members

        /// <summary> Represents the controller for this mask </summary>
        private EqualizerController controller;

        #endregion

        #region Constructor

        /// <summary>
        /// Initializes a new instance of the EqualizerMask class.
        /// </summary>
        public EqualizerMask()
        {
            try
            {
                this.InitializeComponent();
                EqualizerMask.CheckForIllegalCrossThreadCalls = false;

                this.controller = new EqualizerController(this);

                this.ApplyTheme();
            }
            catch (Exception ex)
            {
                Metal.User.UserMessage.ShowError(ex);
            }
        }

        #endregion

        #region Properties

        /// <summary>
        /// Sets the values to view
        /// </summary>
        public int[] Band
        {
            set
            {
                (GetControl("BandEq0") as Gui.Controls.MetalSlider).Value = value[0];
                (GetControl("BandEq1") as Gui.Controls.MetalSlider).Value = value[1];
                (GetControl("BandEq2") as Gui.Controls.MetalSlider).Value = value[2];
                (GetControl("BandEq3") as Gui.Controls.MetalSlider).Value = value[3];
                (GetControl("BandEq4") as Gui.Controls.MetalSlider).Value = value[4];
                (GetControl("BandEq5") as Gui.Controls.MetalSlider).Value = value[5];
                (GetControl("BandEq6") as Gui.Controls.MetalSlider).Value = value[6];
                (GetControl("BandEq7") as Gui.Controls.MetalSlider).Value = value[7];
                (GetControl("BandEq8") as Gui.Controls.MetalSlider).Value = value[8];
                (GetControl("BandEq9") as Gui.Controls.MetalSlider).Value = value[9];
            }
        }

        #endregion
    }
}
